package pcb.control.commands 
{
	import com.intel.patterns.cairngorm.CairngormEvent;
	import com.intel.utils.Debugger;
	import pcb.control.delegates.Del_loadLesson;
	import pcb.control.events.LoadDataEvent;
	import pcb.control.responders.Re_loadLessonText;
	import pcb.models.Notifications;
	
	/**
	 * ...
	 * @author Fintan Boyle
	 */
	public class Cmd_loadLessonText extends AbstractCommand 
	{
		
		public function Cmd_loadLessonText() 
		{
			
		}
		
		override public function execute(event:CairngormEvent):void 
		{
			Debugger.traceOut("Cmd_loadLessonText > execute()");
			loadFile(event as LoadDataEvent);
		}
		
		private function loadFile(ev:LoadDataEvent):void
		{
			var del:Del_loadLesson = new Del_loadLesson(new Re_loadLessonText());
			//daveh - removing the assets folder as the base swf sits inside this
			//del.load(".\\assets\\" + ev.data + "\\" + "xml\\text.xml");
			//del.load(ev.data + "\\" + "xml\\text.xml");
			del.load(ev.data + "/" + "xml/text.xml");
		}
		
	}
	
}